package com.icoding.fw.entities;

import java.util.Date;

import javax.persistence.AttributeOverride;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

@Entity
@Table(name = Account.TABLE)
@AttributeOverride(name = "id", column = @Column(name = Account.COLUMN_ID))
public class Account extends BaseDom {

	public static final String TABLE = "Account";
	public static final String COLUMN_ID = "account_id";

	@Column(name = "username")
	private String username;

	@Column(name = "password")
	private String password;

	@Column(name = "email")
	private String email;

	@Column(name = "full_name")
	private String fullName;

	@Column(name = "date_blocked")
	private Date dateBlocked;

	@Column(name = "date_last_login")
	private Date dateLastLogin;

	@Column(name = "is_suspend")
	private boolean isSuspend;

	@Column(name = "description")
	private String description;

	@Column(name = "date_of_birth")
	private Date dateOfBirth;

	@Column(name = "address")
	private String address;

	@Column(name = "phone")
	private String phone;

	@Column(name = "fax")
	private String fax;

	@Column(name = "num_wrong")
	private Integer numWrong;

	@Column(name = "ip_last_login")
	private String ipLastLogin;

	@Column(name = "session_id")
	private String sessionId;
	
	@Column(name = "non_expired")
	private Boolean nonExpired;

	@Column(name = "non_locked")
	private Boolean nonLocked;

	@Column(name = "credential_non_expired")
	private Boolean credentialsNonExpired;

	@Column(name = "isEnabled")
	private boolean isEnabled;

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getFullName() {
		return fullName;
	}

	public void setFullName(String fullName) {
		this.fullName = fullName;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Date getDateOfBirth() {
		return dateOfBirth;
	}

	public void setDateOfBirth(Date dateOfBirth) {
		this.dateOfBirth = dateOfBirth;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	public Date getDateBlocked() {
		return dateBlocked;
	}

	public void setDateBlocked(Date dateBlocked) {
		this.dateBlocked = dateBlocked;
	}

	public Date getDateLastLogin() {
		return dateLastLogin;
	}

	public void setDateLastLogin(Date dateLastLogin) {
		this.dateLastLogin = dateLastLogin;
	}

	public boolean isSuspend() {
		return isSuspend;
	}

	public void setSuspend(boolean isSuspend) {
		this.isSuspend = isSuspend;
	}

	public Integer getNumWrong() {
		return numWrong;
	}

	public void setNumWrong(Integer numWrong) {
		this.numWrong = numWrong;
	}

	public String getIpLastLogin() {
		return ipLastLogin;
	}

	public void setIpLastLogin(String ipLastLogin) {
		this.ipLastLogin = ipLastLogin;
	}

	public String getSessionId() {
		return sessionId;
	}

	public void setSessionId(String sessionId) {
		this.sessionId = sessionId;
	}

	@Override
	public String toString() {
		return "ID:" + getId() + "- Name:" + getUsername() + " -Email: "
				+ getEmail();
	}

	public Boolean getNonExpired() {
		return nonExpired;
	}

	public void setNonExpired(Boolean nonExpired) {
		this.nonExpired = nonExpired;
	}

	public Boolean getNonLocked() {
		return nonLocked;
	}

	public void setNonLocked(Boolean nonLocked) {
		this.nonLocked = nonLocked;
	}

	public Boolean getCredentialsNonExpired() {
		return credentialsNonExpired;
	}

	public void setCredentialsNonExpired(Boolean credentialsNonExpired) {
		this.credentialsNonExpired = credentialsNonExpired;
	}

	public boolean isEnabled() {
		return isEnabled;
	}

	public void setEnabled(boolean isEnabled) {
		this.isEnabled = isEnabled;
	}

}
